<?php
namespace Admin\Model;
use Think\Model\RelationModel;
/**
 * 用户与角色关联模型
 */
class ManagerRelationModel extends RelationModel{
	//定义主表名称
	protected $tableName='manager';
	//定义关联关系
	protected $_link=array(
		'authgroup'=>array(
			'mapping_type'=>self::MANY_TO_MANY,
			'foreign_key'=>'uid',
			'relation_foreign_key'=>'group_id',
			'relation_table'=>'think_access',
			'mapping_fields'=>'id,title'
			),
		'depot'=>array(
			'mapping_type'=>self::MANY_TO_MANY,
			'foreign_key'=>'uid',
			'relation_foreign_key'=>'depot_id',
			'relation_table'=>'think_userdepot',
			'mapping_fields'=>'id,name,del'
			)
		);
	
}
